
{***************************************************************************************}
{                                                                                       }
{                                   XML Data Binding                                    }
{                                                                                       }
{         Generated on: 02.02.2010 16:32:43                                             }
{       Generated from: LbrDatase.xml                                                   }
{   Settings stored in: LbrDatase.xdb                                                   }
{                                                                                       }
{***************************************************************************************}

unit uLDXMLIntr;

interface

uses xmldom, XMLDoc, XMLIntf;

type

{ Forward Decls }

  IXMLXmlType = interface;
  IXMLSqlsType = interface;
  IXMLSqlType = interface;
  IXMLDisplaylabelType = interface;

{ IXMLXmlType }

  IXMLXmlType = interface(IXMLNode)
    ['{0E9C81FD-1762-4BC0-A1B7-EE4713B94711}']
    { Property Accessors }
    function Get_Sqls: IXMLSqlsType;
    { Methods & Properties }
    property Sqls: IXMLSqlsType read Get_Sqls;
  end;

{ IXMLSqlsType }

  IXMLSqlsType = interface(IXMLNodeCollection)
    ['{2887700B-899F-4C44-A9B8-5EA66B6F85FF}']
    { Property Accessors }
    function Get_Sql(Index: Integer): IXMLSqlType;
    { Methods & Properties }
    function Add: IXMLSqlType;
    function Insert(const Index: Integer): IXMLSqlType;
    property Sql[Index: Integer]: IXMLSqlType read Get_Sql; default;
  end;

{ IXMLSqlType }

  IXMLSqlType = interface(IXMLNode)
    ['{92A2F320-6067-473E-A16E-E19CFF1E5ABB}']
    { Property Accessors }
    function Get_Name: WideString;
    function Get_Displaylabel: IXMLDisplaylabelType;
    procedure Set_Name(Value: WideString);
    { Methods & Properties }
    property Name: WideString read Get_Name write Set_Name;
    property Displaylabel: IXMLDisplaylabelType read Get_Displaylabel;
  end;

{ IXMLDisplaylabelType }

  IXMLDisplaylabelType = interface(IXMLNode)
    ['{1661EC67-FC52-4DB1-BD5A-7E02555EEECF}']
    { Property Accessors }
    function Get_Query: WideString;
    procedure Set_Query(Value: WideString);
    { Methods & Properties }
    property Query: WideString read Get_Query write Set_Query;
  end;

{ Forward Decls }

  TXMLXmlType = class;
  TXMLSqlsType = class;
  TXMLSqlType = class;
  TXMLDisplaylabelType = class;

{ TXMLXmlType }

  TXMLXmlType = class(TXMLNode, IXMLXmlType)
  protected
    { IXMLXmlType }
    function Get_Sqls: IXMLSqlsType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLSqlsType }

  TXMLSqlsType = class(TXMLNodeCollection, IXMLSqlsType)
  protected
    { IXMLSqlsType }
    function Get_Sql(Index: Integer): IXMLSqlType;
    function Add: IXMLSqlType;
    function Insert(const Index: Integer): IXMLSqlType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLSqlType }

  TXMLSqlType = class(TXMLNode, IXMLSqlType)
  protected
    { IXMLSqlType }
    function Get_Name: WideString;
    function Get_Displaylabel: IXMLDisplaylabelType;
    procedure Set_Name(Value: WideString);
  public
    procedure AfterConstruction; override;
  end;

{ TXMLDisplaylabelType }

  TXMLDisplaylabelType = class(TXMLNode, IXMLDisplaylabelType)
  protected
    { IXMLDisplaylabelType }
    function Get_Query: WideString;
    procedure Set_Query(Value: WideString);
  end;

{ Global Functions }

function Getxml(Doc: IXMLDocument): IXMLXmlType;
function Loadxml(const FileName: WideString): IXMLXmlType;
function Newxml: IXMLXmlType;

const
  TargetNamespace = '';

implementation

{ Global Functions }

function Getxml(Doc: IXMLDocument): IXMLXmlType;
begin
  Result := Doc.GetDocBinding('xml', TXMLXmlType, TargetNamespace) as IXMLXmlType;
end;

function Loadxml(const FileName: WideString): IXMLXmlType;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('xml', TXMLXmlType, TargetNamespace) as IXMLXmlType;
end;

function Newxml: IXMLXmlType;
begin
  Result := NewXMLDocument.GetDocBinding('xml', TXMLXmlType, TargetNamespace) as IXMLXmlType;
end;

{ TXMLXmlType }

procedure TXMLXmlType.AfterConstruction;
begin
  RegisterChildNode('sqls', TXMLSqlsType);
  inherited;
end;

function TXMLXmlType.Get_Sqls: IXMLSqlsType;
begin
  Result := ChildNodes['sqls'] as IXMLSqlsType;
end;

{ TXMLSqlsType }

procedure TXMLSqlsType.AfterConstruction;
begin
  RegisterChildNode('sql', TXMLSqlType);
  ItemTag := 'sql';
  ItemInterface := IXMLSqlType;
  inherited;
end;

function TXMLSqlsType.Get_Sql(Index: Integer): IXMLSqlType;
begin
  Result := List[Index] as IXMLSqlType;
end;

function TXMLSqlsType.Add: IXMLSqlType;
begin
  Result := AddItem(-1) as IXMLSqlType;
end;

function TXMLSqlsType.Insert(const Index: Integer): IXMLSqlType;
begin
  Result := AddItem(Index) as IXMLSqlType;
end;

{ TXMLSqlType }

procedure TXMLSqlType.AfterConstruction;
begin
  RegisterChildNode('displaylabel', TXMLDisplaylabelType);
  inherited;
end;

function TXMLSqlType.Get_Name: WideString;
begin
  Result := ChildNodes['name'].Text;
end;

procedure TXMLSqlType.Set_Name(Value: WideString);
begin
  ChildNodes['name'].NodeValue := Value;
end;

function TXMLSqlType.Get_Displaylabel: IXMLDisplaylabelType;
begin
  Result := ChildNodes['displaylabel'] as IXMLDisplaylabelType;
end;

{ TXMLDisplaylabelType }

function TXMLDisplaylabelType.Get_Query: WideString;
begin
  Result := ChildNodes['query'].Text;
end;

procedure TXMLDisplaylabelType.Set_Query(Value: WideString);
begin
  ChildNodes['query'].NodeValue := Value;
end;

end.